a = importdata('pattern_freq.txt');
[n,d] = size(a.data);
for i = 1:n
    x = -d:1:-1;
    y = a.data(i, :);
    h = clf;
    plot(x, y, '+-', 'LineWidth', 2);
    title(a.rowheaders{i});
    xlabel('position');
    ylabel('count (over 915 genes)');
    print(h, '-dpdf', ['figures/pattern_' num2str(i) '_' a.rowheaders{i} ...
                       '.pdf']);
end